V = Variables
R = Reading function
UNSIGNED BYTE —→ BINARY
The VR10UbyToBin function Converts a variable of Unsigned Byte type (byte without sign) in a variable of Binary type.
VR10UByToBin (value, index, array, errcode)
Parameters:
| IN/OUT | VARIABLE TYPE | EXAMPLE NAME | DIM | |
|---|---|---|---|---|
| IN | GLOBAL | value | W | Data value to convert |
| IN | GLOBAL | index | L | Index of the array element to start the “deposit” of the converted data |
| OUT | ARRGBL | array | B | Array containing the converted data (must be declared at least “index” elements) |
| OUT | GLOBAL | errcode | F | Variable that indicates a possible error on the function |
Una volta richiamata la funzione, 'errcode' può assumere determinati valori, il significato di tali valori è riassunto di seguito:
0: Nessun errore
1: Errore: il dato di ritorno è minore di 0 oppure maggiore di 255
Trasforma il valore 200 (unsigned byte) in un valore binario
value = 200 index = 1 VR10UbyToBin (value, index, array, errcode) ;Sull'array si troverà : ; array[1] = -56